<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>index</title>
</head>
<body>

<div>卡号<span th:text="${session.user.cardNo}"></span>
    <a th:href="@{/info/logout}">退出登录</a>
</div>

<div style="float: left">


    <ul>
        <li>
            <a th:href="@{/info/tobalance}">查询余额</a>
        </li>
        <li>
            <a th:href="@{/info/totransfer}">转账</a>
        </li>
        <li>
            <a th:href="@{/info/torecord}">查询交易记录</a>
        </li>
        <li>
            <a th:href="@{/info/toupdatePwd}">修改密码</a>
        </li>


    </ul>
</div>

<div style="float: left">
    <h1>当前操作查询交易记录</h1>

    <form action="/info/list" method="get">

        查询日期范围<input name="start">
        到
        <input name="end">
        <input type="submit" value="查询">
    </form>

    <div th:if="${page!=null}">

        <h1 th:if="${#lists.isEmpty(page.list)}" th:text="没有找到数据"></h1>
        <table border="1" th:if="${!#lists.isEmpty(page.list)}">
            <tr>
                <th>交易日期</th>
                <th>支出</th>
                <th>存入</th>
                <th>账户余额</th>
                <th>交易类型</th>
                <th>备注</th>
            </tr>
            <tr th:each="info:${page.list}">
                <td th:text="${#dates.format(info.getTransaction_date(),'yyyy-MM-dd')}"></td>
                <td th:text="${info.expense}"></td>
                <td th:text="${info.income}"></td>
                <td th:text="${info.balance}"></td>
                <td th:text="${info.transaction_type}"></td>
                <td th:text="${info.remark}"></td>
            </tr>
            <tr>
                <td colspan="6">
                    <a th:href="@{|/info/list?pageNo=1&start=${start}&end=${end}|}" th:text="首页"></a>
                    <a th:href="${pageNo>1}?@{|/info/list?pageNo=${pageNo-1}&start=${start}&end=${end}|}:'javascript:;'">上一页</a>
                    <a th:href="${pageNo<page.pageCount}?@{|/info/list?pageNo=${pageNo+1}&start=${start}&end=${end}|}:'javascript:;'">下一页</a>
                    <a th:href="@{|/info/list?pageNo=${page.pageCount}&start=${start}&end=${end}|}" th:text="末页"></a>
                    第<span th:text="${pageNo}"></span>页/共<span th:text="${page.pageCount}"></span>页
                </td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>